luci-app-ddns: fix creation of custom service (fix #4926)
authorJulien Cassette <[email protected]>
Sun, 2 Oct 2022 18:14:19 +0000 (20:14 +0200)
committerJulien Cassette <[email protected]>
Wed, 12 Oct 2022 11:07:23 +0000 (13:07 +0200)
The `service_name` option must be empty for custom services,
otherwise an error is raised in `dynamic_dns_updater.sh`.

Signed-off-by: Julien Cassette <[email protected]>
(cherry picked from commit 85ff9db2bffd3d2bf119300d9297f1b524608e1b)

applications/luci-app-ddns/htdocs/luci-static/resources/view/ddns/overview.js

index 4b786e83c52a6df5f4e97b1f9471be0c09045743..28dfb44f0eb3befd2d2844696b4234f702b96aa9 100644 (file)
@@ -475,7 +475,9 @@ return view.extend({
 
                        return m.save(function() {
                                uci.add('ddns', 'service', section_id);
-                               uci.set('ddns', section_id, 'service_name', service_value);
+                               if (service_value != '-') {
+                                       uci.set('ddns', section_id, 'service_name', service_value);
+                               }
                                uci.set('ddns', section_id, 'use_ipv6', ipv6_value);
                        }).then(L.bind(m.children[1].renderMoreOptionsModal, m.children[1], section_id));
                };